package com.cloud.rou.im.msg.enumtype;

import java.util.Arrays;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 */
public enum  MsgType {
    /**
     * CHAT
     */
    CHAT((byte) 1),
    /**
     * Used for client login and logout
     */
    LOGIN((byte) 2),
    LOGOUT((byte) 3),

    /**
     * 心跳
     */
    HEARTBEAT((byte) 4);


    private byte type;

    MsgType(byte type) {
        this.type = type;
    }

    /**
     * get the enum class
     * @param type the type
     * @return the enum class
     */
 /*   public static MsgType getEnum(Byte type) {
        return type == null ? null : Arrays.stream(values())
                .filter(t -> t.getType() == type)
                .findFirst()
                .orElse(null);
    }*/
}
